package com.ims.model;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ims.DAO.StudentDAO;

/**
 * Servlet implementation class StudentReg
 */
public class StudentReg extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public StudentReg() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String firstName = request.getParameter("firstname");
		String lastName = request.getParameter("lastname");
		String gender = request.getParameter("gender");
		String DOB = request.getParameter("dob");
		
		long departmentId = Long.parseLong(request.getParameter("departmentid"));
		String address = request.getParameter("address");
		String yearEnroled = request.getParameter("yearenroled");
		Float CGPA = Float.parseFloat(request.getParameter("cgpa"));
		String email = request.getParameter("email");
		String phoneNumber = request.getParameter("phonenumber");
		
		StudentDAO stu = new StudentDAO();
		/*stu.setStudentId(2);
		stu.setFirstName(firstName);
		stu.setLastName(lastName);
		stu.setGender(gender);
		stu.setDob(DOB);
		stu.setDeptId(departmentId);
		stu.setAddress(address);
		stu.setOverallGPA(CGPA);
		stu.setEmailAddress(email);
		stu.setPhoneNumber(phoneNumber);
		
		System.out.print(firstName);
		long a =stu.saveStudent();*/
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
